* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.8;
  color: #1a1a1a;
  background: #f4f0e8;
  padding: 0;
  margin: 0;
  position: relative;
}

/* SVG grain noise overlay — archival paper texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ==========================================================================
   INVESTIGATIVE REDACTION — Fixed background effect
   ========================================================================== */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-scene .paper-texture {
  position: absolute;
  inset: 0;
  background: #f4f0e8;
}

.bg-scene .paper-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.18'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.bg-scene .paper-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 31px,
    rgba(150, 140, 120, 0.12) 31px,
    rgba(150, 140, 120, 0.12) 32px
  );
}

.bg-scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#stainCanvas  { z-index: 2; }
#mainCanvas   { z-index: 3; }

/* Page content layer — sits above the background effect */
.page-layer {
  position: relative;
  z-index: 5;
}

/* Semi-transparent dim container — only behind .content */
.content {
  background: rgba(244, 240, 232, 0.82);
  backdrop-filter: blur(1.5px);
}

@media (prefers-reduced-motion: reduce) {
  #mainCanvas { display: none; }
}

/* Masthead — newspaper nameplate, consistent on all pages */
.masthead {
  background: #2a2218;
  color: #e8dcc8;
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  max-width: 960px;
  margin: 0 auto;
}
.masthead-wrap {
  background: #2a2218;
}
.masthead-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8dcc8;
  text-decoration: none;
  border-bottom: none;
}
.masthead-title:hover {
  color: #fff;
  border-bottom: none;
}
.masthead-sub {
  font-size: 0.75rem;
  color: #a09880;
  letter-spacing: 0.04em;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
}

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Hero header image */
.hero {
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
  background: #2a2218;
}
.hero img {
  width: 100%;
  display: block;
  height: auto;
}

/* ==========================================================================
   SITE NAVIGATION — below hero, on every page
   ========================================================================== */
.site-nav-wrap {
  background: #2a2218;
  border-top: 1px solid #4a4030;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.site-nav a {
  color: #a09880;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover {
  color: #e8dcc8;
  border-bottom-color: #8b2500;
}
.site-nav a.active {
  color: #e8dcc8;
  border-bottom-color: #8b2500;
}

/* Site header (index/articles page — below nav) */
.site-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #1a1a1a;
}
.site-header h1 {
  font-size: 1.6rem;
  border: none;
  margin: 0;
  letter-spacing: 0.02em;
}
.site-header p {
  color: #665e50;
  font-size: 0.9rem;
  margin: 0.3rem 0 0;
}
.site-intro {
  text-align: center;
  font-size: 0.95rem;
  color: #2a2218;
  max-width: 580px;
  margin: 0 auto 1rem;
  line-height: 1.7;
}
.site-links {
  text-align: center;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: #665e50;
  margin-bottom: 1.5rem;
}

/* Typography */
h1 { font-size: 2rem; margin: 1.5rem 0 0.5rem; line-height: 1.2; }
h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.5rem;
  border-bottom: 1px solid #c8bfad;
  padding-bottom: 0.3rem;
}

/* Redaction bars on headings */
article h2::before,
article h2::after {
  content: '';
  display: inline-block;
  background: #1a1a1a;
  height: 0.7em;
  vertical-align: middle;
  border-radius: 1px;
}
article h2::before {
  width: 1.2em;
  margin-right: 0.5em;
}
article h2::after {
  width: 0.7em;
  margin-left: 0.5em;
}
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.4rem; color: #4a4030; }
h4 { font-size: 1rem; margin: 1.2rem 0 0.3rem; }

p { margin: 0.8rem 0; }

a { color: #8b2500; text-decoration: none; border-bottom: 1px solid #d4a88c; }
a:hover { color: #5e1900; border-bottom-color: #5e1900; }

/* Blockquotes — document excerpt feel */
blockquote {
  margin: 1.2rem 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid #8b2500;
  background: #ede8dd;
  color: #2a2218;
  font-style: italic;
}
blockquote p { margin: 0.3rem 0; }

/* Code — redacted document style */
code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  background: #1a1a1a;
  color: #f5f0e8;
  padding: 0.2em 0.5em;
  border-radius: 2px;
}

pre {
  background: #2a2218;
  color: #e8dcc8;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border-radius: 3px;
  margin: 1.2rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  line-height: 1.6;
  border: 1px solid #4a4030;
}
pre code { background: none; padding: 0; color: inherit; }

hr { border: none; border-top: 1px solid #c8bfad; margin: 2rem 0; }

em { font-style: italic; }
strong { font-weight: 700; }

img { max-width: 100%; height: auto; cursor: pointer; }

/* Tables — evidence log feel */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9em;
}
th, td {
  border: 1px solid #c8bfad;
  padding: 0.5rem 0.7rem;
  text-align: left;
}
th { background: #2a2218; color: #e8dcc8; font-weight: 700; }
td { background: #f5f0e8; }
tr:nth-child(even) td { background: #ede8dd; }

ul, ol { margin: 0.8rem 0 0.8rem 1.5rem; }
li { margin: 0.3rem 0; }

/* Table of contents (articles page) */
.toc { list-style: none; margin-left: 0; }
.toc li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #c8bfad;
}
.toc .num {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #8b2500;
  display: inline-block;
  width: 2.2rem;
  font-weight: 700;
}
.toc .title { font-weight: 600; }
.toc .subtitle {
  display: block;
  color: #665e50;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

/* Article subtitle (converted from h3 for proper hierarchy) */
.subtitle {
  font-size: 1.15rem;
  color: #4a4030;
  margin: 0.4rem 0 1rem;
  font-style: italic;
}

/* Navigation */
.article-nav {
  margin: 2.5rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid #c8bfad;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.article-nav a {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  color: #8b2500;
}

/* Pagination */
.pagination {
  margin: 2rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid #c8bfad;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}
.pagination a { color: #8b2500; }
.page-num { color: #665e50; }

/* Source note (footer) */
.source-note {
  font-size: 0.85rem;
  color: #665e50;
  font-style: italic;
}

/* Trigger warning */
.trigger-warning {
  background: #2a2218;
  color: #e8dcc8;
  padding: 0.8rem 1.2rem;
  border-radius: 3px;
  font-size: 0.9em;
  margin: 1rem 0;
  border-left: 3px solid #8b2500;
}

/* Discussion link */
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #c8bfad;
}
.comments h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
}
.comments-note {
  font-size: 0.85rem;
  color: #665e50;
  font-style: italic;
  margin-bottom: 1rem;
}
.discuss-btn {
  display: inline-block;
  background: #2a2218;
  color: #e8dcc8;
  padding: 0.6rem 1.4rem;
  border-radius: 3px;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: none;
  text-decoration: none;
}
.discuss-btn:hover {
  background: #3d3225;
  color: #fff;
  border-bottom: none;
}
.community-link {
  font-size: 0.85rem;
  color: #665e50;
}

/* Support / Donate */
.support {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #c8bfad;
}
.support h2 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  border-bottom: none;
}
.support h2::before,
.support h2::after { display: none; }
.support-note {
  font-size: 0.85rem;
  color: #665e50;
  font-style: italic;
  margin-bottom: 1rem;
}
.wallet {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.wallet-label {
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b2500;
  min-width: 5rem;
}
.wallet-addr {
  font-size: 0.72rem;
  background: #ede8dd;
  color: #2a2218;
  padding: 0.3em 0.6em;
  border-radius: 2px;
  word-break: break-all;
  user-select: all;
  cursor: pointer;
}
.support-compact {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #c8bfad;
}
.support-compact .support-note {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   CHANNEL CARDS — contact page
   ========================================================================== */
.channel {
  background: #ede8dd;
  border: 1px solid #c8bfad;
  border-left: 3px solid #8b2500;
  border-radius: 3px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0 1.8rem;
}
.channel p { margin: 0.5rem 0; }
.channel ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.channel li { margin: 0.25rem 0; }

/* Security level badges */
.security-level {
  display: inline-block;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.7em;
  border-radius: 2px;
  margin-bottom: 0.6rem;
}
.level-good {
  background: #4a6741;
  color: #e8dcc8;
}
.level-better {
  background: #5a4a1a;
  color: #e8dcc8;
}
.level-best {
  background: #2a2218;
  color: #e8dcc8;
}

/* PGP key block */
.pgp-key {
  font-size: 0.7em;
  line-height: 1.4;
  max-height: 12rem;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
  margin: 0.8rem 0;
}

/* ==========================================================================
   MEDIA GALLERY
   ========================================================================== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.media-card {
  background: #ede8dd;
  border: 1px solid #c8bfad;
  border-radius: 3px;
  overflow: hidden;
}
.media-thumb {
  display: block;
  border-bottom: none;
}
.media-thumb:hover {
  border-bottom: none;
}
.media-thumb img {
  width: 100%;
  display: block;
  height: auto;
  transition: opacity 0.15s;
}
.media-thumb:hover img {
  opacity: 0.85;
}
.media-caption {
  padding: 0.6rem 0.8rem 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2a2218;
}
.media-source {
  padding: 0 0.8rem 0.6rem;
  font-size: 0.75rem;
  color: #665e50;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  cursor: default;
  border-radius: 2px;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #e8dcc8;
  font-size: 2rem;
  font-family: -apple-system, Helvetica, Arial, sans-serif;
  cursor: pointer;
  line-height: 1;
  z-index: 10001;
}
.lightbox-close:hover {
  color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 600px) {
  .content { padding: 1.2rem 1rem 2rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  table { font-size: 0.8em; }
  .toc .subtitle { font-size: 0.85rem; }
  .masthead { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.2rem; }
  .masthead-title { font-size: 0.8rem; }
  .masthead-sub { display: none; }
  .site-nav { padding: 0.4rem 1rem; gap: 0.15rem 0.8rem; font-size: 0.72rem; }
  .channel { padding: 1rem; }
  .media-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .media-caption { font-size: 0.78rem; padding: 0.4rem 0.6rem 0.1rem; }
  .media-source { font-size: 0.68rem; padding: 0 0.6rem 0.4rem; }
}

/* ==========================================================================
   SITE FOOTER — navbar-coloured bar with BTC + license
   ========================================================================== */
.site-footer {
  background: #2a2218;
  color: #d4c8b0;
  text-align: center;
  padding: 1.4rem 1.5rem 1.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
}
.site-footer .support-line {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #e8dcc8;
  letter-spacing: 0.02em;
}
.site-footer .wallet {
  justify-content: center;
  margin: 0 0 0.8rem;
}
.site-footer .wallet-label {
  background: #8b2500;
  color: #fff;
}
.site-footer .wallet-addr {
  background: #3a3228;
  color: #c8bfad;
  border-color: #4a4238;
}
.site-footer .btc-help {
  margin: 0.3rem 0 0.8rem;
  font-size: 0.76rem;
}
.site-footer .license-line {
  margin: 0;
  font-size: 0.78rem;
  color: #998e7a;
}
.site-footer a {
  color: #d4a574;
}
.site-footer a:hover {
  color: #e8c89a;
}

@media (max-width: 400px) {
  .media-grid { grid-template-columns: 1fr; }
}
